package com.paziy.jan.graphics;

public class MyWindow implements Movable {

    private static final int DEFAULT_X = 0;
    private static final int DEFAULT_Y = 0;

    private int x = DEFAULT_X;
    private int y = DEFAULT_Y;

    public MyWindow() {}

    public MyWindow(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public int getX() {
        return x;
    }

    @Override
    public int getY() {
        return y;
    }

    @Override
    public void moveTo(int x, int y) {
        System.out.print(toString() + " moved to ");

        this.x = x;
        this.y = y;

        System.out.print(toString());
    }

    @Override
    public void move(int dX, int dY) {
        System.out.print(toString() + " move to ");

        x += dX;
        y += dY;

        System.out.print(toString());
    }

    @Override
    public String toString() {
        return "MyWindow: x: " + x + "; y: " + y + ";";
    }

}
